package com.bmj.study;

import com.bmj.study.dao.ResumeDAO;
import com.bmj.study.entity.Resume;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

@SpringBootApplication
public class MongoTemplateMain {

    public static void main(String[] args) {
        ApplicationContext applicationContext = SpringApplication.run(MongoTemplateMain.class, args);
        ResumeDAO resumeDAO = applicationContext.getBean("resumeDAO", ResumeDAO.class);
        for (int i = 1; i <= 1000; i++) {
            Resume resume = new Resume();
            resume.setName("张三" + i);
            resume.setExpectSalary(i);
            resumeDAO.insertResume(resume);
        }
        Resume resume = resumeDAO.findByName("张三2");
        System.out.println(resume);

    }
}
